cd D:\Dropbox\book_welfare\

*******************************************************
*******************************************************
*****  FINAL         **********************************
*******************************************************
*******************************************************


cd D:\Dropbox\book_welfare\replication\dofiles\

* execute the programs to create the basic datasets  

do create_data\read_books.do 
/* notes:
this reads goodreads_books.json, which is 
available at https://mengtingwan.github.io/data/goodreads 
*/


do create_data\get_trussel_pseudonyms.do 
/* notes.  This reads from https://www.trussel.com/books/pseud_a.htm, etc
*/


do create_data\create_author_data.do 
/* note: this reads from goodreads_book_authors.json, which is available 
at https://mengtingwan.github.io/data/goodreads 
*/




do create_data\create_bookid_oyear.do
/* note: this reads from goodreads_book_works.json, which is available 
at https://mengtingwan.github.io/data/goodreads 
*/


do create_data\create_book_id_genres.do
/* note: this reads from goodreads_book_genres_initial.json, which is available 
at https://mengtingwan.github.io/data/goodreads 
*/

do create_data\create_book.do
/* note: this reads from book_id_map.csv (from https://mengtingwan.github.io/data/goodreads), 
also from the files created by read_books.do above.
*/


do create_data\create_book_author_mapping_part.do
/* note: this reads from goodreads_books.json  (https://mengtingwan.github.io/data/goodreads)
*/


do create_data\create_books_year.do
* this reads from files created above 

do create_data\create_user_genre.do 
* note: reads from  goodreads_interactions.csv (from goodreads_interactions.csv) 

do create_data\create_books_year_types.do
* reads from datasets created above 


do create_data\read_loc_data.do
* reads from data from https://www.loc.gov/item/2020445551  


* create final bookstat datasets
do create_data\create_author_title_data_asin.do
* this reads from files I can't share, but produces 4 main analysis files I can share:
*  data\bookstat_gender_pyear_genre_asin.dta
*  data\bookstat_sales_gender_pyear_genre_asin.dta 
*  data\bookstat_2021_welfare_asin.dta 
*  data\bookstat_sales_gender_pyear_genre_decile_asin.dta

do create_data\create_loc_data_asin.do
* reads from files created above 

* create award and other success datasets 
do create_data\create_bestseller_data.do
do create_data\create_pulitzer_data.do
do create_data\create_nba_data.do


* analysis 
do analysis\summary_stats_gender_match_asin.do 
do analysis\female_supply_figure_asin.do 
do analysis\descriptive_regressions_asin_weighted.do 
do analysis\female_author_share_growth_figure_asin.do
do analysis\genre_growth_sales_figure_asin.do
do analysis\coefficient_by_genre_figure_asin.do
do analysis\coefficient_by_reader_type_figure_weighted.do
do analysis\coefficient_by_sales_decile_figure_asin.do
do analysis\awards_regressions_asin.do
do analysis\predictability_regressions_asin.do
do analysis\entry_displacement_regression_asin.do
do analysis\welfare_Xbeta_gr.do
do analysis\welfare_Xbeta_bs_asin.do
do analysis\make_figure_delta_CS_by_type_gr.do
do analysis\simulated_ds_dn_asin.do
do analysis\analyze_pseudonyms.do
